#include<iostream>
using std::cout;
using std::cin;
using std::endl;

int main(void)
{
	int n,m,i,j,sum;
	cin >> n;
	int *num;
	for ( i=0;i<n;i++ )
	{
		cin >> m;
		num = new int[m];
		sum = 0;
		for ( j=0;j<m;j++ )
		{
			cin >> num[j];
			sum += num[j];
		}
		delete [] num;
		if (i==0)
		 cout << sum << endl;
	    else
		 cout << endl << sum << endl;
	}
	return 0;
}